package com.coderfans.redis;

/**
 * Created by ${fanchunshuai} on 2016-11-15.
 *
 * @version: V1.0
 * @Desc:
 * @Copyright (c) 2016 58到家-版权所有
 */
public class RedisConfigBean {
    public RedisConfigBean(){}
    //redis服务器的ip
    private  String JEDIS_HOST ;

    //Redis的端口号
    private  int PORT;

    //可用连接实例的最大数目，默认值为8；
    //如果赋值为-1，则表示不限制；
    // 如果pool已经分配了maxActive个jedis实例，
    // 则此时pool的状态为exhausted(耗尽)。
    private  int MAX_ACTIVE;


    //控制一个pool最多有多少个状态为idle(空闲的)的jedis实例，默认值也是8。
    private  int MAX_IDLE;

    //等待可用连接的最大时间，单位毫秒，默认值为-1，表示永不超时，如果
    //超出等待时间则抛出JedisConnectionException
    private  int MAX_WAIT ;

    private  int TIMEOUT ;

    public boolean isTEST_ON_BORROW() {
        return TEST_ON_BORROW;
    }

    public void setTEST_ON_BORROW(boolean TEST_ON_BORROW) {
        this.TEST_ON_BORROW = TEST_ON_BORROW;
    }

    public int getMAX_WAIT() {
        return MAX_WAIT;
    }

    public void setMAX_WAIT(int MAX_WAIT) {
        this.MAX_WAIT = MAX_WAIT;
    }

    public int getMAX_IDLE() {
        return MAX_IDLE;
    }

    public void setMAX_IDLE(int MAX_IDLE) {
        this.MAX_IDLE = MAX_IDLE;
    }

    public String getJEDIS_HOST() {
        return JEDIS_HOST;
    }

    public void setJEDIS_HOST(String JEDIS_HOST) {
        this.JEDIS_HOST = JEDIS_HOST;
    }

    public int getPORT() {
        return PORT;
    }

    public void setPORT(int PORT) {
        this.PORT = PORT;
    }

    public int getMAX_ACTIVE() {
        return MAX_ACTIVE;
    }

    public void setMAX_ACTIVE(int MAX_ACTIVE) {
        this.MAX_ACTIVE = MAX_ACTIVE;
    }

    public int getTIMEOUT() {
        return TIMEOUT;
    }

    public void setTIMEOUT(int TIMEOUT) {
        this.TIMEOUT = TIMEOUT;
    }

    //在borrow一个jedis实例时，是否提前进行validate操作，如果为true,则得到的jedis实例均是可用的
    private  boolean TEST_ON_BORROW ;


    @Override
    public String toString() {
        return "RedisConfigBean{" +
                "JEDIS_HOST='" + JEDIS_HOST + '\'' +
                ", PORT=" + PORT +
                ", MAX_ACTIVE=" + MAX_ACTIVE +
                ", MAX_IDLE=" + MAX_IDLE +
                ", MAX_WAIT=" + MAX_WAIT +
                ", TIMEOUT=" + TIMEOUT +
                ", TEST_ON_BORROW=" + TEST_ON_BORROW +
                '}';
    }
}
